What is a module?

back to section start!

A module is nothing else than a library. This has at least 2 functions for DOpus to use and only one of these is important for us.

Note:
If you use a different compiler than SAS (or Storm), you must take care of the positions of both functions. In this case you may refer also CLib37x.lha (AmiNet) and your compiler manual.


If you have never created a shared library before, you must know some things before about:

  • because a library can not expect some IO channels (stdin, stdout), you can not include the "stdio.h". You can also not use a simple printf() without to have a valid (checked and locked) output window.

  • your code must always end with a "return". "exit" is not allowed in libraries (, because stderr is also not available).

  • due the possibility of more than one process running in this library, you should not use global variables, which may be modified by a process. If you need this, use a SignalSemaphore to allow only one access at the same time.

  • you can not use to recursing functions since you have a fixed stacksize. There is always a way around... (In Code_fragments/ScanTree.c you can see an example how to scan a complete device for files without having to recurse...)

DOpus PLUS - giving you that bit extra...